#ifndef __DFS_H_
#define __DFS_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "dfs_config.h"

/* File types */
#define FT_REGULAR               0   /* regular file */
#define FT_SOCKET                1   /* socket file  */
#define FT_DIRECTORY             2   /* directory    */
#define FT_USER                  3   /* user defined */

/* File flags */
#define DFS_F_OPEN              0x01000000
#define DFS_F_DIRECTORY         0x02000000
#define DFS_F_EOF               0x04000000
#define DFS_F_ERR               0x08000000


struct dirent
{
    uint8_t d_type;           /* The type of the file */
    uint8_t d_namlen;         /* The length of the not including the terminating null file name */
    uint16_t d_reclen;        /* length of this record */
    char d_name[DFS_PATH_MAX];   /* The null-terminated file name */
};

/* export func */

int dfs_init(void);
int dfs_user_init(void);

int dfs_fd_new(void);
struct dfs_fd *dfs_fd_get(int fd);
void dfs_fd_put(struct dfs_fd *obj);


#ifdef __cplusplus
}
#endif

#endif // __DFS_H_
